package cn.btks.resultintegration.achievements.service;

import cn.btks.commonserver.result.ResultState;
import cn.btks.resultintegration.achievements.pojo.TextAchievements;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;

/**
 * @Author lijun
 * @Date 2021/1/6 12:10
 */
public interface TextAchievementsService {

    /**
     * 根据环境管控单元编码查询
     * @param unitCode
     * @return
     */
    TextAchievements findByUnitCode(String unitCode);

    /**
     * 分页查询成果管控清单
     * @param pageNumber
     * @param pageSize
     * @param code 编码
     * @param city 师
     * @param county 团
     * @return
     */
    ResultState findPage(Integer pageNumber, Integer pageSize, String code, String city, String county);

//    /**
//     * 保存文本成果
//     * @param textAchievements
//     * @return
//     */
//    ResultState save(TextAchievements textAchievements);

    /**
     * 保存文本成果
     * @param textAchievements
     * @param multipartFile
     * @param request
     * @return
     */
    ResultState save(TextAchievements textAchievements, MultipartFile multipartFile, HttpServletRequest request);

    /**
     * 批量保存
     * @param achievements
     * @return
     */
    ResultState saveAll(List<TextAchievements> achievements);

    /**
     * 上传文本成果
     * @param multipartFile
     * @param request
     * @return
     */
    ResultState upload(MultipartFile multipartFile, HttpServletRequest request) throws IOException;

    /**
     * 更新文本成果
     * @param textAchievements
     * @return
     */
    ResultState update(TextAchievements textAchievements);

    /**
     * 根据ID删除文本成果
     * @param id
     * @return
     */
    ResultState delete(Long id);

    /**
     * 导出查询的管控单元清单
     * @param code
     * @param cityName
     * @param request
     * @return
     * @throws IOException
     */
    ResultState export(String code,String cityName, HttpServletRequest request) throws IOException;
}
